<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>模态框</title>
    <style>
        nav{
            background-color: red;
        }
        .popup{
            position: fixed;
            top: 50%;
            left: 50%;
            /* margin-left: -250px;
            margin-top: -200px; */
            transform: translate(-50%,-50%);
            width: 500px;
            height: 400px;
            background-color: yellow;
            z-index: 99;
        }
        body>.popup>h3{
            background-color: pink;
        }
        .popup>h3{
            background-color: green;
        }
        .mask{
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color:rgba(0,0,0,.3);
        }
    </style>
</head>
<body>
    <nav>导航</nav>
    <div class="popup">
        <h3>标题</h3>
    </div>
    <!-- 遮罩层 -->
    <div class="mask"></div>
    <img style="margin-top: 3000px;" src="./imgs/hnkz.jpg" alt="">
    <p style="margin-top: 3000px;">dkdjssjdjlsjdsjdsl</p>
</body>
</html>